﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace PeertoPeerObjectShare.PacketHandler
{
    public class CommentPackage : PackageHandler
    {
       
          public CommentPackage(string to, string from, string message)
            : base(to, from, message)
        {
            packtype = "COMMENT";

        }



        public override string Create()
        {
            message = "[COMMENT]: " + message;
            return message;

        }

        public override void Reset()
        {
            message = "";
        }

        public override string toJSON()
        {
            string json;
            try
            {
                json = JsonConvert.SerializeObject(this);
                return json;
            }
            catch (JsonSerializationException exception)
            {

                Console.WriteLine(exception.Message, "JSON COMMENTPACKAGE Serialization Failed");
            }
            return string.Empty;

        }



    }
}
